<?php
namespace Admin\Model;

use Think\Model;

class AppconfigModel extends Model {


    /**
     * 根据关键字获取指定配置值
     * @param $varname
     * @return bool|mixed
     */
    public function get($varname) {
        $value = $this->where("varname = '{$varname}'")->getField('value');
        if (empty($value)) return false;
        return $value;
    }

    public function set($varname,$value) {
        return (bool) $this->where("varname = '{$varname}'")->setField('value',$value);
    }


}